<%-- 
    Document   : form2ECUE
    Created on : 22 mars 2013, 00:49:49
    Author     : ali
--%>

<%@page import="EDT.obj.Ec"%>
<%@page import="EDT.obj.Ue"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.ArrayList"%>
<%@page import="EDT.obj.Formation"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                
        <title>Affecter un EC à une UE 2</title>
            <link rel="stylesheet" href="Accueil.css" />
            <link rel="SHORTCUT ICON" href="./edt.jpg" />
    </head>


    <body>    
         
    <section>
           
    <!--<form method='POST' action='PromoNivGradForm.do'> -->
   <%
   String form ="";
   
    ArrayList<Formation> formation = (ArrayList<Formation> ) session.getAttribute("formation");
        form +="<form method='POST' action='AffectECUEAction.do' target='section'>\n";
        form += "<div class='commentaire'>\n";
        form += "<fieldset>";
        

        form += "<legend>    Choisissez un ec et une UE  :   </legend>";
        form += "<input type='hidden' name='key' value='"+session.getAttribute("key")+"'/>";
        
        String idf =request.getParameter("formation");
        form += "<input type='hidden' name='formation' value='"+idf+"'/>"; 
            
        
        form += "Ue :   <select name='ue'>";
        int idfInt = Integer.parseInt(idf);
        ArrayList<Ue> ues = EDT.api.API.getUe((String)session.getAttribute("key"),idfInt);
        
        for (Ue ue : ues)
           
                    form += "<option value='"+ue.getId()+"'>"+ue.getNom()
                    +" Semestre: "+ue.getNperiode()+"</option>";
                
        form += "</select><br/><br/>";
    
        
                session.removeAttribute("formation");
       
                    
       ArrayList<Ec> ecs = EDT.api.API.getEc((String)session.getAttribute("key"));
        
       form += "Ec :   <select name='ec'>";
       for (Ec ec : ecs)
           
                    form += "<option value='"+ec.getId()+"'>"+ec.getNom()+"</option>";
                
        form += "</select><br/><br/>";
        
        form +="Nombre H de Cours :<input type='text' name='nbrcm'/><br/><br/>";
        form +="Nombre H de TD/TME :<input type='text' name='nbrtd'/><br/><br/>";
        form +="Le Coefficient :<input type='text' name='coeff'/><br/><br/>";
            
        form += "<input type='submit' value='valider'/><br/>";
        out.println(form);
            
    %>
    

    <html:errors/> 
    
    </fieldset>

    </div>

    </form>
         
    </section>
    </body>
</html>
